const {createProxyMiddleware} = require('http-proxy-middleware')
module.exports = function (app){
    app.use('/api1',createProxyMiddleware({ //遇见/api1前缀的请求就会触发该代理配置
            target:"http://localhost:5000", //请求转发给谁
            changeOrigin:true,  //控制服务器中收到的请求头中的host字段的值
            pathRewrite:{'^/api1':''}//重写请求路径
        })
    )   
}